<?php

namespace App\Models;



class Video extends Orm
{
    //
    protected $table = 'video';
    protected $dateFormat = 'U';
    public $timestamps = true;


    public function setPicsAttribute($value)
    {
        $this->dealSetImageAttribute('pics', $value);
    }

    public function getPicsAttribute()
    {
        if(!empty($this->attributes['pics'])){
            return json_decode($this->attributes['pics'],true);
        }
        return [];
    }

    public function setVideoUrlAttribute($value)
    {
        $this->dealSetImageAttribute('video_url', $value);
    }

    public function campusInfo()
    {
        return $this->belongsTo(Campus::class, 'campus_id');
    }
}
